package com.qf.tenant.manager.api;

import com.qf.common.bean.R;
import com.qf.tenant.manager.service.AreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 千锋健哥
 */
@RestController
@RequestMapping("/tenant/area")
public class AreaController {

    @Autowired
    private AreaService areaService;

    @GetMapping("/parentId/{parentId}")
    public R<List> findByParentId(@PathVariable(value = "parentId") Integer parentId) {
        R<List> result = areaService.findByParentId(parentId);
        return result;
    }
}
